<?php
namespace App\Http\Controllers\Evaluation;
use App\Http\Controllers\BaseApiController;
use Illuminate\Http\Request;
use App\Services\Evaluation\Evaluation;

class EvaluationController extends BaseApiController
{
    public $eval;
    public function __construct(Evaluation $evaluation)
    {
        $this->eval = $evaluation;
    }
    //我的测评
    public function my(){

        $res = $this->eval->my();
        return $this->result('30000',$res,'success');
    }
    //查看测评结果
    public function seeEvaluationRes(Request $request){

        //接收测试记录id
        $id= $request->post('id');
        $data['id'] = $id;
        $val = $this->idFind($data);
        if($val->fails()){
            $error = $val->errors();
            return $error;
        }
        $res = $this->eval->seeEvaluationRes($id);
        return $this->result('30000',$res,'success');
    }
}